home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1997 November / MACPOWER-1997-11.ISO.7z / MACPOWER-1997-11.ISO / AMUG / MUSIC / bol-processor-271-data.sit / bol-processor-271-data / BP2 examples / BP2 data / -gr.tryrepeat < prev    next >
Text File  |  1996-06-25  |  664b  |  21 lines

  1. // Bol Processor version BP2.6.1
  2. // Grammar file saved as '-gr.tryrepeat'. Date: Mar 25 Juin 1996 -- 19:20
  3. -se.tryrepeat
  4. -ho.abc
  5.  
  6. // This grammar creates a string a...b...c... with equal number of occurrences of a,b,c.  The number is set by K1
  7. // Two important points:
  8. // (1) use 'ORD' so that erase rules are not seen first
  9. // (2) use weights <1-1> so that the 'repeat' rules are seen once only.
  10. // You would get similar results with 'RND' if erase rules are in the next subgrammar
  11. // You can avoid weights by using '_failed(x,y)' procedures
  12.  
  13. ORD
  14.  
  15. S --> X Y Z
  16. <1-1> X --> a X _repeat(K1=3)
  17. <1-1> Y --> b Y _repeat(K1)
  18. <1-1> Z --> c Z _repeat(K1)
  19. X -->
  20. Y -->
  21. Z -->